<?php
die;
require('includes/application_top.php');

$lng_id = 2; // languages_id

$filename = 'pub/kathmandu_db.csv';
$delimiter = ',';

$category_arr = array(9 => 'category');

$products_arr = array(
					  3 => 'products_price',
					  4 => 'products_price_wholesale');

$row = 0;
if (($handle = fopen($filename, "r")) !== false) {
	fgetcsv($handle, 1000, $delimiter); // abort first line
	
	while (($data = fgetcsv($handle, 1000, $delimiter)) !== false) {
		//if($data[2] == '') continue;
		
		$row++;
		
		//product
		echo $row . ') ' . $data[2] . "<br />\n";
			
		if($data[3] == '') $data[3] = 0;
		if($data[4] == '') $data[4] = 0;
		
		tep_db_query("update products set products_price = '" . tep_db_prepare_input($data[3]) . "', products_price_wholesale = '" . tep_db_prepare_input($data[4]) . "' where products_id = " . $row);
    }
	echo $row;
    fclose($handle);
} else {
	echo 'error!!!';
}

/*-------------------------------- funtions ---------------------------------------------*/

/*-------------------------------- funtions-end ---------------------------------------------*/

require('includes/application_bottom.php');
?>